package com.aspose.cells;

class zalx extends zbz {
   private zast a;
   private Line d;

   zalx(int var1, zast var2) {
      this.a = var2;
      this.c(4103);
      this.b = var1;
      this.b(12);
      this.c = new byte[12];
      this.c[6] = -1;
      this.c[7] = -1;
      this.c[8] = 9;
      this.c[10] = 77;
   }

   void a() {
      this.c[4] = 5;
      this.c[8] = 8;
      this.c[10] = 77;
   }

   void a(Line var1, int var2) {
      this.d = var1;
      if (!this.d.isVisible()) {
         this.c[4] = 5;
         this.c[6] = -1;
         this.c[7] = -1;
         this.c[8] = 8;
         this.c[10] = 77;
      } else {
         int var3;
         if (!com.aspose.cells.a.c.zh.a(this.d.getColor())) {
            var3 = this.a.a(this.d.getColor());
            if (var3 != -1) {
               this.c[0] = com.aspose.cells.a.c.zh.b(this.d.getColor());
               this.c[1] = com.aspose.cells.a.c.zh.c(this.d.getColor());
               this.c[2] = com.aspose.cells.a.c.zh.d(this.d.getColor());
               this.c[10] = (byte)var3;
               this.c[8] = 0;
            } else {
               Color var4 = this.d.getColor();
               var3 = this.a.a(com.aspose.cells.a.c.zh.b(var4) & 255, com.aspose.cells.a.c.zh.c(var4) & 255, com.aspose.cells.a.c.zh.d(var4) & 255);
               this.c[0] = com.aspose.cells.a.c.zh.b(this.d.getColor());
               this.c[1] = com.aspose.cells.a.c.zh.c(this.d.getColor());
               this.c[2] = com.aspose.cells.a.c.zh.d(this.d.getColor());
               this.c[10] = (byte)var3;
               this.c[8] = 0;
            }
         } else if (var1.isAuto()) {
            this.c[0] = 0;
            this.c[1] = 0;
            this.c[2] = 0;
            this.c[10] = 77;
            this.c[8] = 9;
         } else {
            var3 = (32 + var2) % 56;
            this.c[10] = (byte)var3;
            this.c[8] = 0;
         }

         this.c[4] = (byte)this.d.getStyle();
         if (this.d.getWeight() == -1) {
            this.c[6] = -1;
            this.c[7] = -1;
         } else {
            this.c[6] = (byte)this.d.getWeight();
            this.c[7] = 0;
         }

         if (this.d.isAuto()) {
            this.c[8] = (byte)(this.c[8] | 1);
         } else {
            this.c[8] = (byte)(this.c[8] & 254);
         }

      }
   }

   void a(Line var1, boolean var2) {
      this.d = var1;
      if (!com.aspose.cells.a.c.zh.a(this.d.getColor())) {
         Color var3 = this.d.getColor();
         int var4 = this.a.a(var3);
         if (var4 != -1) {
            this.c[0] = com.aspose.cells.a.c.zh.b(this.d.getColor());
            this.c[1] = com.aspose.cells.a.c.zh.c(this.d.getColor());
            this.c[2] = com.aspose.cells.a.c.zh.d(this.d.getColor());
            this.c[10] = (byte)var4;
            this.c[8] = (byte)(this.c[8] & 7);
            if (var2) {
               this.c[8] = 4;
            }
         } else {
            var4 = this.a.a(com.aspose.cells.a.c.zh.b(var3) & 255, com.aspose.cells.a.c.zh.c(var3) & 255, com.aspose.cells.a.c.zh.d(var3) & 255);
            if (var4 != -1) {
               this.c[0] = com.aspose.cells.a.c.zh.b(this.d.getColor());
               this.c[1] = com.aspose.cells.a.c.zh.c(this.d.getColor());
               this.c[2] = com.aspose.cells.a.c.zh.d(this.d.getColor());
               this.c[10] = (byte)var4;
               this.c[8] = (byte)(this.c[8] & 7);
               if (var2) {
                  this.c[8] = 4;
               }
            }
         }
      } else {
         this.c[0] = 0;
         this.c[1] = 0;
         this.c[2] = 0;
         this.c[10] = 77;
         this.c[8] = 9;
      }

      this.c[4] = (byte)this.d.getStyle();
      if (!this.d.isVisible()) {
         this.c[4] = 5;
         if (var2) {
            this.c[8] = 4;
         }
      }

      if (this.c[4] != 0 && var2) {
         this.c[8] = 4;
      }

      if (this.d.getWeight() == -1) {
         this.c[6] = -1;
         this.c[7] = -1;
      } else {
         this.c[6] = (byte)this.d.getWeight();
         this.c[7] = 0;
      }

      if (this.d.isAuto()) {
         this.c[8] = (byte)(this.c[8] | 1);
      } else {
         this.c[8] = (byte)(this.c[8] & 254);
      }

   }
}
